Alrighty.
Welcome.
This lecture is where we are going to set up everything we need to start scripting our game.
You may see me building the map in the background of this lecture, and I'm going to lay the foundation
for what we're going to need in our map.
First we're going to need to spawn areas for our players.
The first spawn area is going to hold all of our dead players while they are in the main guy.
The second spawn area is going to be on our map.
Our map should have four areas that zombies can spawn at, so it's not possible for the players to camp
one particular zombie spawning area.
Our map should also include a shop where players can purchase gear at the end of each wave.
Lastly, our map should be impossible to escape, meaning we should have invisible walls to prevent
players or zombies from wandering outside of the map.
All of the assets you will need for this project, including the map, has been attached to this lecture.
However, feel free to manipulate the map or even create your own from scratch.
So let's go ahead and get started.
I'm going to create a new empty base plate.
So now we can go ahead and delete both the spawn location and the base plate, because the game assets
that I've attached are going to contain everything you'll need.
So we can go ahead and open up our toolbox and insert the game assets here are mine right here.
We'll drag that into the game.
And now here is everything that we're going to need for our game.
As you can see, we already have a big base plate for the game.
We have some nice city buildings surrounding just for the aesthetic.
As well as an area.
If we go back here in our map, here is an area where we're going to hold all of the dead players in
our game.
As you can see, here is one of the spawn locations for them.
And then the other spawn location for alive players is going to be on our map.
This invisible spawn location.
When players join into our game, they're going to be spawning right here in the middle of our map.
Now, as I stated, you want to have four different areas that zombies can spawn at.
As you can see on our map, one area is going to be right here, another is going to be over here,
one is going to be over here, and the other one is going to be over here.
So I have four different areas that zombies can spawn at.
And inside each of these areas there is an invisible part stored in this folder called zombie spawns.
And these are the different areas that we can spawn our zombies.
And inside each one of these is an attachment which we're going to go ahead and set the zombie keyframe
to when we want to spawn them in the map.
We also have a shop in the middle of our map with an invisible part, and this part has a proximity
prompt inside of it, and this is where players can go up, trigger the prompt, and open up a shop
guy during the intermission between different waves where they can go ahead and buy other equipment.
We also have ammo boxes that players are going to be able to use to refill the ammo in their guns when
they run out.
We also have invisible walls all around the map to prevent zombies and players from being able to climb
out and get outside of the map's boundaries, which we don't want.
So we've added all of these invisible walls to prevent that from happening.
We also want to prevent players from being able to enter into the spawn areas of zombies.
So that's why we have another set of invisible walls.
And each of these invisible walls has a collision group called Zombie Walls.
Now, since we've created a new game, that means the collision groups are not going to be set up for
us.
So we need to go ahead and set up some collision groups.
So if we head over to the model tab and open up collision groups, we're going to want to add three
collision groups, one for zombies, one for players.
And we're going to want to add one for the Zombie Walls collision group.
So we can go ahead and add one for zombie walls.
The other group we need to add is zombie.
And then we also need to add a collision group for players.
Now we want to make sure that zombies are able to walk through these invisible walls, but not players.
So we're going to make sure that zombies cannot collide with anything tagged as zombie walls in their
collision group.
However, we do want players to be able to collide with zombie walls, but we won't want players to
collide with other players, so we're going to uncheck that right there.
In fact, if you take a look at each one of our zombies and we were to select one of their limbs.
If we check their cohesion group.
As you can see, they should automatically be set to zombie for you.
And that way when we go and highlight over the zombie collision group, as you can see, it highlights
each one of those parts showing us the collision group for our zombie.
If we click zombie walls, their highlights, each of the different walls that zombies are going to
be able to walk through, but players are not going to be able to walk through.
So now what we can go ahead and do is that inside of our game assets model, we can go ahead and take
each of these models and ungroup them in their respective service.
So for example this model right here needs to be Ungrouped and replicated storage.
So we'll move that there.
Do control new and ungroup that.
This needs to be Ungrouped in server storage.
So we'll move that over there and group it there.
This one goes to starter Guy.
We'll ungroup that one.
This one goes into teams.
So we'll move that down there and ungroup that.
And then this one needs to be ungrouped in the workspace.
So we'll just make it a child of the workspace controlling U and ungroup that.
And now we no longer need this game assets model.
So on your screen you should see all of this UI stuff.
If you would like to hide that, we can go to the view tab and disable UI visibility for now.
Because one more thing I would like to show you is that inside each of those invisible parts where our
zombies can walk through, each of them have a child inside of them called a pathfinding modifier.
And the purpose of this is to allow our zombies, when we code an AI, for them to be able to see these
parts as non-existent and be able to pathfind through those parts, which why the property inside of
here, called paths through, is set to true.
We have these modifiers inside of these invisible walls, as well as within the different spawn parts.
For our zombies, they also have the same pathfinding modifier, so it's important that these pathfinding
modifiers are children of the different invisible parts that we would like our zombies to walk through.
Now, another thing we want to go ahead and verify is that each of the spawn plates are set to the correct
team.
So if we go ahead and look at our live team and our dead team, as you can see they are set to the sea
green team color and the dusty rose team color respectively.
Make sure that your dead team has auto assignable set to true, and that your live team has auto assignable
set to false.
And then we want to go ahead and check that our live spawn is set to the same color as our live team,
which is sea green.
And then we also want to verify that each of our dead spawns are also set to the dead team color of
dusty Rose.
So if we go and look through, as you can see, they're all set to dusty Rose.
And the alive spawn is set to see green.
And we also want to make sure that each of these spawn plates do not have allow team change on touch
enabled or neutral enabled.
Now if I re-enable UI visibility.
As you can see, I've already created the UI for the game, right?
You already have all of the UI assets.
However, in the next lecture I'm still going to show you how to create this UI and exactly what process
I use for creating UI in my games.
So now that we have everything set up and in the correct places, I'll go ahead and see you in the next
lecture.